package September29;

import java.io.*;
import java.util.*;

public class TemplateReplacer {
    public static void main(String[] args) {
        String templateContent = "您的运单号为{danhao}的快件已到达{weizhi},请根据提取码{tiquma}提取，感谢您的支持";
        String danhao = "123456789";
        String weizhi = "北京市";
        String tiquma = "ABC123";

        String replacedContent = templateContent.replace("{danhao}", danhao)
                .replace("{weizhi}", weizhi)
                .replace("{tiquma}", tiquma);

        try (BufferedWriter writer = new BufferedWriter(new FileWriter("物流.txt"))) {
            writer.write(replacedContent);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
